home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / Source / Chapter 9 / Engine / Material.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-10-01  |  1.3 KB  |  37 lines

  1. //-----------------------------------------------------------------------------
  2. // A material which consists of a texture and lighting properties.
  3. //
  4. // Programming a Multiplayer First Person Shooter in DirectX
  5. // Copyright (c) 2004 Vaughan Young
  6. //-----------------------------------------------------------------------------
  7. #ifndef MATERIAL_H
  8. #define MATERIAL_H
  9.  
  10. //-----------------------------------------------------------------------------
  11. // Material Class
  12. //-----------------------------------------------------------------------------
  13. class Material : public Resource< Material >
  14. {
  15. public:
  16.     Material( char *name, char *path = "./" );
  17.     virtual ~Material();
  18.  
  19.     IDirect3DTexture9 *GetTexture();
  20.     D3DMATERIAL9 *GetLighting();
  21.     unsigned long GetWidth();
  22.     unsigned long GetHeight();
  23.     bool GetIgnoreFace();
  24.     bool GetIgnoreFog();
  25.     bool GetIgnoreRay();
  26.  
  27. private:
  28.     IDirect3DTexture9 *m_texture; // Direct3D texture.
  29.     D3DMATERIAL9 m_lighting; // Lighting properties.
  30.     unsigned long m_width; // Width of the texture.
  31.     unsigned long m_height; // Height of the texture.
  32.     bool m_ignoreFace; // Indicates if faces with this material should be ignored.
  33.     bool m_ignoreFog; // Indicates if this material is to ignore fog when rendered.
  34.     bool m_ignoreRay; // Indicates if this material is to ignore ray intersections.
  35. };
  36.  
  37. #endif